package com.smqj.icu;

import java.io.*;
import java.sql.SQLException;
import javax.servlet.http.*;
import javax.servlet.annotation.*;

@WebServlet(name = "file2Gp", value = "/file2Gp")
public class ICUImport extends HttpServlet {

    public void doPost(HttpServletRequest request, HttpServletResponse response) {
        String type = request.getParameter("type");
        String path = request.getParameter("path");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json; charset=utf-8");
        try {
            Long count = null;
            File2Gp  gp = new File2Gp();
            count = gp.dealFiles2Gp(type,path,1);
            PrintWriter writer = response.getWriter();
            writer.append(count + "");
        } catch (SQLException | IOException e) {
            e.printStackTrace();
        }
    }

    public void destroy() {
    }
}
